﻿<%@ Page Title="" Language="C#" MasterPageFile="~/site.master" AutoEventWireup="true"
    CodeFile="productSearchResult.aspx.cs" Inherits="Productsearch_result" %>

<%@ Register Src="Components/SearchBox.ascx" TagName="SearchBox" TagPrefix="uc" %>
<%@ Register TagPrefix="uc" Namespace="Taopi.WebComponents" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        
    </style>
    <link href="Styles/searchCommon.css" rel="stylesheet" type="text/css" />
    <link href="Styles/ShopThumbnail.css" rel="Stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div id="searchBar">
        <uc:SearchBox ID="searchBox" runat="server" ClientIDMode="Static" SearchScope="Product" />
    </div>
    <section id="titleArea">
        <h2>
            Search for Product:
            <asp:Label ID="keywordsLabel" runat="server" Text="Label" /></h2>
    </section>
    <div id="searchResultArea">
        <asp:LinqDataSource ID="searchResultSource" runat="server" OnSelecting="searchResultSource_Selecting" />
        <div id="filterArea">
            <fieldset>
                <legend>Category</legend>
                <asp:LinqDataSource ID="categorySource" runat="server" OnSelecting="categorySource_Selecting" />
                <asp:CheckBoxList ID="productCategoryList" runat="server" DataSourceID="categorySource"
                    AutoPostBack="True" RepeatLayout="Flow">
                </asp:CheckBoxList>
            </fieldset>
            <fieldset>
                <legend>Price</legend>
                <div>
                    <asp:CheckBox ID="greaterThanCheckBox" runat="server" Text="Greater than" />
                    $<asp:TextBox ID="highPriceTextBox" runat="server" Width="42px" />
                </div>
                <div>
                    <asp:CheckBox ID="lessThanCheckBox" runat="server" Text="Less than" />
                    $<asp:TextBox ID="lowPriceTextBox" runat="server" Width="45px" />
                </div>
                <asp:Button ID="priceFilterButton" runat="server" Text="Apply" OnClick="priceFilterButton_Click" />
            </fieldset>
        </div>
        <div id="filterResultArea">
            <div>
                <span>Sort by
                <asp:DropDownList ID="sortingMethodList" runat="server" AutoPostBack="True">
                    <asp:ListItem Value="Natural Order">Natural Order</asp:ListItem>
                    <asp:ListItem Value="Sold Amount">Sold Amount</asp:ListItem>
                    <asp:ListItem Value="Rating">Rating</asp:ListItem>
                    <asp:ListItem Value="Price">Price</asp:ListItem>
                    <asp:ListItem Value="Discount">Discount</asp:ListItem>
                </asp:DropDownList>
                </span>
            </div>
            <asp:LinqDataSource ID="sortedResultSource" runat="server" OnSelecting="sortedResultSource_Selecting">
            </asp:LinqDataSource>
            <asp:ListView ID="ListView1" runat="server" DataSourceID="sortedResultSource" ViewStateMode="Disabled">
                <LayoutTemplate>
                    <ul id="itemList">
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder" />
                    </ul>
                </LayoutTemplate>
                <ItemTemplate>
                    <li>
                        <uc:ProductThumbnail ID="ProductThumbnail" ProductId='<%# Eval("id") %>' ProductName='<%# Eval("name") %>'
                            ProductPrice='<%# Eval("price") %>' ProductCategory='<%# Eval("category") %>'
                            CoverPhoto='<%# Eval("coverPhoto") %>' Owner='<%# Eval("owner") %>' runat="server" />
                    </li>
                </ItemTemplate>
            </asp:ListView>
            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" PageSize="3">
                <Fields>
                    <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowNextPageButton="False"
                        ShowPreviousPageButton="False" />
                    <asp:NextPreviousPagerField ButtonType="Button" ShowNextPageButton="False" />
                    <asp:NumericPagerField />
                    <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" ShowPreviousPageButton="False" />
                </Fields>
            </asp:DataPager>
        </div>
    </div>
</asp:Content>
